package com.nanhai.buddhist.college.module.study.dal.mysql.studyadditionalcourses;

import java.util.*;

import com.nanhai.buddhist.college.framework.common.pojo.PageResult;
import com.nanhai.buddhist.college.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.nanhai.buddhist.college.framework.mybatis.core.mapper.BaseMapperX;
import com.nanhai.buddhist.college.module.study.dal.dataobject.studyadditionalcourses.StudyAdditionalCoursesStudentDO;
import org.apache.ibatis.annotations.Mapper;
import com.nanhai.buddhist.college.module.study.controller.admin.studyadditionalcourses.vo.*;

/**
 * 学生选课 Mapper
 *
 * @author xqenzo@163.com
 */
@Mapper
public interface StudyAdditionalCoursesStudentMapper extends BaseMapperX<StudyAdditionalCoursesStudentDO> {

    default PageResult<StudyAdditionalCoursesStudentDO> selectPage(StudyAdditionalCoursesStudentPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<StudyAdditionalCoursesStudentDO>()
                .eqIfPresent(StudyAdditionalCoursesStudentDO::getStudyAdditionalCoursesId, reqVO.getStudyAdditionalCoursesId())
                .eqIfPresent(StudyAdditionalCoursesStudentDO::getClassesId, reqVO.getClassesId())
                .eqIfPresent(StudyAdditionalCoursesStudentDO::getStudentId, reqVO.getStudentId())
                .eqIfPresent(StudyAdditionalCoursesStudentDO::getAuditStatus, reqVO.getAuditStatus())
                .betweenIfPresent(StudyAdditionalCoursesStudentDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(StudyAdditionalCoursesStudentDO::getCreateTime));
    }

    default List<StudyAdditionalCoursesStudentDO> selectList(StudyAdditionalCoursesStudentExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<StudyAdditionalCoursesStudentDO>()
                .eqIfPresent(StudyAdditionalCoursesStudentDO::getStudyAdditionalCoursesId, reqVO.getStudyAdditionalCoursesId())
                .eqIfPresent(StudyAdditionalCoursesStudentDO::getClassesId, reqVO.getClassesId())
                .eqIfPresent(StudyAdditionalCoursesStudentDO::getStudentId, reqVO.getStudentId())
                .eqIfPresent(StudyAdditionalCoursesStudentDO::getAuditStatus, reqVO.getAuditStatus())
                .betweenIfPresent(StudyAdditionalCoursesStudentDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(StudyAdditionalCoursesStudentDO::getCreateTime));
    }

}
